package com.lemonfish.pojo.entity;

import com.baomidou.mybatisplus.annotation.FieldStrategy;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import lombok.experimental.Accessors;
import org.hibernate.validator.constraints.Length;

import java.util.Date;
import java.util.List;

/**
 * 分类参数 Entity定义
 *
 * @author Lemonfish
 * @version 1.0
 * @date 2020-03-09
 * Copyright © Chao Zhang
 */
@ApiModel(value = "分类参数")
@Getter
@Setter
@Accessors(chain = true)
@ToString
public class GoodsParam extends BaseCustomEntity {

    private static final long serialVersionUID = -69982547332902111L;

    // 参数名称
    @ApiModelProperty(value = "参数名称", example = "1")
    @Length(max = 100, message = "参数名称长度应小于100")
    @TableField()
    private String name;

    // 参数类型
    @ApiModelProperty(value = "参数类型", example = "false")
    @TableField()
    private Boolean paramType;

    // 父级id
    @ApiModelProperty(value = "父级id", example = "1")
    @TableField()
    private Long parentId;

    // 更新时间
    @ApiModelProperty(value = "更新时间", example = "2020-03-09 20:34")
    @TableField(insertStrategy = FieldStrategy.NEVER, updateStrategy = FieldStrategy.NOT_NULL)
    private Date updateTime;

    @TableField(exist = false)
    private List<GoodsParam> children;
}
